/*
 * @Author: FanWeiHua
 * @Date: 2021-07-27 09:41:08
 * @LastEditTime: 2021-08-02 17:38:51
 * @Description:
 */
import Vue from 'vue';
import VueRouter from 'vue-router';
// 操作
const Handle = () => import('../view/handle/index.vue');
Vue.use(VueRouter);
const router = new VueRouter({
  mode: webpackConfig.nodeEnv === 'local' ? 'hash' : 'history',
  base: webpackConfig.publicPath || '/',
  routes: [
    {
      name: '初始化',
      path: '/',
      component: Handle,
      children: [
        {
          name: '指令流转',
          path: 'instruct',
          component: () => import('../view/instruct/instruct.vue')
        }
      ]
    }
  ]
});
// 路由元信息,全局的导航钩子
router.beforeEach((to, from, next) => {
  next();
});
/**
 * 引入可以访问
 */
const routerStore = router;
export { router, routerStore };
